home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group01b.txt
/
000071_icon-group-sender_Wed Jun 6 16:37:20 2001.msg
< prev
next >
Wrap
Internet Message Format
|
2002-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f56NawM23962
for icon-group-addresses; Wed, 6 Jun 2001 16:36:58 -0700 (MST)
Message-Id: <200106062336.f56NawM23962@baskerville.CS.Arizona.EDU>
From: "John Sampson" <jsampson@indexes.u-net.com>
To: <icon-group@cs.arizona.edu>
Subject: Re: [Icon-Group] Funny result with strings
Date: Wed, 6 Jun 2001 22:54:23 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1431
Hello -
Thanks for the advice.
Further to my previous, I tried passing a string to Steve Hunter's procedure
in the same way as I was passing it to 'split' in my original program (see
code below). Here I have used '$' as the delimiter, and changed the
procedure code accordingly. It works. Putting the French colon '|' back
instead of '$', I find that the same thing happens with 'tug' as with
'split'. The problem, as suggested, must lie with DOS rather than Icon - it
arises when the string is read from standard input, i.e. from the DOS prompt
from Windows 95. DOS sabotages French colons. In that case I assume it won't
matter how making a list is done in Icon - the same problem will arise. The
only cure is to change the delimiter or change the operating system.
Regards
_John Sampson_
#------------------
procedure main()
s := read()
fr_colon(s)
end
procedure fr_colon(arg_l)
local l
arg_l ? every put(l:=[], tug(~'$')) # Steve Hunter's calling procedure
changed
\/write(!l)
end
#`tug' stands for: tab(upto()) and generate-cs-spans.
# On exhaustion, |&pos| is restored to the on-call value, but, this
# still doesn't
# qualify as a true matching-expression, because |tug|() doesn't return
# the entire
# contiguous span between the on-entry |&pos| and (each) post-eval
# |&pos|.
procedure tug(cs) # Written by Steve Hunter
local Li
cs := cset(cs)
suspend tab(|(upto(cs,,Li)\1)) & tab(Li := many(cs))
end